From 6aae3dc5ef93913fcab06e484e7f455ad8b641bd Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 15 May 2008 14:19:14 +0000 Subject: [PATCH] Move endian detection back to runtime to benefit universal binaries on Mac. --- util.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util.c b/util.c index 8ded3ea2a..41286af81 100644 --- a/util.c +++ b/util.c @@ -29,11 +29,17 @@ #include #include +// First test Apple's clever macro that's really a runtime test so +// that our universal binaries work right. +#if defined __BIG_ENDIAN__ +#define i_am_little_endian !__BIG_ENDIAN__ +#else #if defined WORDS_BIGENDIAN # define i_am_little_endian 0 #else # define i_am_little_endian 1 #endif +#endif #ifdef DEBUG_MEM #define DEBUG_FILENAME "/tmp/gpsbabel.debug" -- 2.30.2